package com.tao.config;


import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.EnableWebMvc;
import springfox.documentation.service.ApiInfo;
import springfox.documentation.service.Contact;
import springfox.documentation.spi.DocumentationType;
import springfox.documentation.spring.web.plugins.Docket;
import springfox.documentation.swagger2.annotations.EnableSwagger2;
import java.util.ArrayList;

@Configuration //配置类
@EnableSwagger2
public class SwaggerConfig {

//          地址 ： /swagger-ui.html

    //配置文档信息
    private ApiInfo apiInfo() {
        Contact contact = new Contact("返回主页", "./index.html", "联系人邮箱");
        return new ApiInfo(
                "SpringBoot", // 标题
                "SpringBoot +shiro +bootstrap", // 描述
                "v1.1", // 版本
                "http://121.5.24.66:8080/myssm", // 组织链接
                contact, // 联系人信息
                "Apach 2.0 许可", // 许可
                "许可链接",// 许可连接

                new ArrayList<>()// 扩展
        );
    }

    @Bean
    public Docket docket() {
        return new Docket(DocumentationType.SWAGGER_2).apiInfo(apiInfo());
    }
}